﻿<?php
require('conn.php');
//require('session.php');
require('functions.php');
//print_r($userdata);
$uid=guolv($_GET['uid']);
$typeid=trim($_GET['type']);
$page=$_GET['page'];
if(is_numeric($page)==false){
	$page=1;
	$page_1=1;
	$min=0;
	$page_2=$page+1;
}else{
	if($page>1){
		$page_2=$page+1;
		$min=($page-1)*20;
		$page_1=$page-1;	
	}else{
		$page_1=1;
		$min=0;
		$page_2=2;
	}
	
}
//默认排序
if(!isset($_GET['do']) && !isset($_GET['page']) && $config['ListOrder']!=='' && !isset($_GET['type'])){
	_location("?do={$config['ListOrder']}&uid={$uid}",'js');
	exit;
}

//自定义列表文章显示数量
if(is_numeric($config['ListArticle'])){
	$max=$page*$config['ListArticle'];
}else{
	$max=$page*30;
}

if(is_numeric($typeid)==false){
	$rows=$mysql->query("select * from `rw` where `top`!='-1' and  `sh`=1 and lx=1 order by -`top`,`id` desc limit {$min},{$max}");
}else{
	$rows=$mysql->query("select * from `rw` where `type`='{$typeid}' and `top`!='-1' and  `sh`=1  and lx=1 order by  -`top`,-`money`  limit {$min},{$max}");	
}
//金钱排序
if($_GET['do']=='money'){
	$rows=$mysql->query("select * from `rw` where `top`!='-1' and  `sh`=1 and lx=1 order by   -`top`,-`money`  limit {$min},{$max}");
}
//最热
if($_GET['do']=='hot'){
	$rows=$mysql->query("select * from `rw` where `top`!='-1' and  `sh`=1 and lx=1  order by -`top`,-`pv` limit {$min},{$max}");
}
//随机
if($_GET['do']=='rand'){
	$rows=$mysql->query("select * from `rw` where `top`!='-1' and  `sh`=1 and lx=1 order by -`top`,rand() limit {$min},{$max}");
}
//最新
if($_GET['do']=='new'){
	$rows=$mysql->query("select * from `rw` where `top`!='-1' and  `sh`=1 and lx=1 order by -`top`,`id` desc limit {$min},{$max}");
}
?>
<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width">
        <meta name="format-detection" content="telephone=no">
        <meta http-equiv="Cache-Control" content="max-age=0">
        <meta name="apple-touch-fullscreen" content="yes">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <title>转发就赚钱 - <?php echo $config['sitename']?></title>
		<meta name="description" content="<?php echo $config['sitename']?>">
		<meta name="keywords" content="<?php echo $config['sitename']?>" />
        <link rel="stylesheet" href="static/css/font-awesome.min.css" />
        <style>
            html, body{
                height: 100%;
                width:100%;
            }
            body{margin:0;font-family:"微软雅黑","Microsoft Yahei","Helvetica Neue",Helvetica,Arial,sans-serif;font-size:12px;overflow-x: hidden;color: #3a4049;height: 100%;background: #fff}
            body.withHeader {
                padding-top: 45px;
            }
            body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,textarea,blockquote,p {
                padding: 0;
                margin: 0;
            }*,*:before,*:after {
                 -webkit-box-sizing:border-box;
                 -moz-box-sizing:border-box;
                 box-sizing:border-box
             }
            .clear:before,.clear:after{
                content: " ";
                display: table;
            }
            input,select,textarea {
                outline: 0;
                background-color: #fff;
                border: 1px solid #D9D9D9;
                display: inline-block;
                padding: 5px 6px 3px;
                font-size: 12px;
                line-height: 20px;
                color: #555555;
                vertical-align: middle;
                resize: none;
            }
			.has_action{min-height: 100px; }
            em {
                font-style:normal;
                font-weight:normal;
            }
            img{max-width:100%;width:auto\9;height:auto;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}
            ol,ul,li {
                list-style-type:none;
                padding:0;
                margin:0;
            }
            ol,ul,li {
                list-style-type:none;
            }
			
            a {
                text-decoration:none;
                outline:none;
                color: #333;
                text-shadow:none;
                resize: none;
            }
            a:hover {
                outline:none;
                text-shadow:none;
            }
            div, input, select, textarea, span, img, table, td, th, p, a, button, ul, li,i {
                border-radius: 0 ;/*!important*/
                -moz-border-radius: 0;
                -webkit-border-radius: 0 ;
                outline:0 none;
            }
			/* 底部浮层 */
			.positionFooter {
				background: #f3f3f3;
				bottom: 0;
				left: 0;
				position: fixed;
				width: 100%;
				z-index: 200;
				border-top: 1px solid #ddd
			}
			.positionFooter li {
				float: left;
				position: relative;
				text-align: center;
				width: 33.3%;
				color: #3096c6;
				padding: 5px 0
			}
			.positionFooter li a {
				color: #8e8e8e;
				padding-top: 30px;
				font-size: 14px;
				display: block
			}
			.positionFooter li a.a1 {
				background: url(static/index/b1.png) no-repeat top center;
				background-size: 30px 27px
			}
			.positionFooter li a.a2 {
				background: url(static/index/b2.png) no-repeat top center;
				background-size: 30px 27px
			}
			.positionFooter li a.a3 {
				background: url(static/index/b3.png) no-repeat top center;
				background-size: 30px 27px
			}
            header{
                display: block;
                z-index: 999;
                overflow: hidden;
                position: fixed;
                top: 0;
                left: 0;
                right: 0;
            }
			.cmt{font-size: 16px; color:#F00;
    line-height: 22px;}
            .top_bar{
                height: 44px;
                position: relative;
                background: rgba(255,50,50,.95);
            }
            .top_bar .abs_m {
                width: 100%;
                text-align: center;
                font-size: 20px;
                color: #fff;
                font-weight: bold;
                line-height: 44px;
            }
            .top_menu_bar{background:rgba(255,255,255,0.95);  height: 37px; }
            .top_menu{overflow:hidden; overflow-x:scroll; -webkit-overflow-scrolling:touch; }
            .top_menu::-webkit-scrollbar { display: none; }
            .top_menu_list {
                white-space: nowrap;
            }
            .top_menu_list .btn.cur {
                color: #d00;
                font-size: 15px;
                background: #ddd;
                border-radius: 20px;
            }
            .top_menu_list .btn {
                white-space: nowrap;
                display: inline-block;
                padding: 0 10px;
                color: #333;
                text-decoration: none;
                font-size: 14px;
                line-height: 26px;
                height: 26px;
                margin: 5px 0px 5px 5px;
                border-radius: 20px;
            }
			.btn-login {
				display: inline-block;
				width: 48%;
				height: 40px;
				border-radius: 3px;
				background: #B9B9B9;
				text-decoration: none;
				line-height: 39px;
				text-align: center;
				font-size: 17px;
				color: rgb(255, 255, 255);
			}			
            .list_content{-webkit-user-select:none;position: relative;}
            section{ border-bottom:1px solid #f0f0f0; position: relative; background-color: #fff}
            .list_content section:last-child{ border-bottom: 1px solid #f0f0f0; }
            section .article_link{ display:block;   text-decoration:none; -webkit-tap-highlight-color:rgba(0,0,0,.1); -webkit-touch-callout:none;}

            section h3{ color:#464646; font-size:17px; font-weight:normal; margin: 0; padding:0; line-height: 1.2em; text-align: justify;}
            .iphone section{ padding: 2px }
            .iphone section .article_link,
            .iphone section h3{ font-weight: bold;}
            .item_info{ font-size: 11px; line-height: 18px; margin-top: 10px; color: #999; position: relative;   width:100% }
            section.middle_mode .article_link{  }
            section.middle_mode h3{ margin-left:120px;}
            section.middle_mode .list_img_holder{ overflow: hidden; position: absolute; left: 10px; top:50%; margin-top: -31px;border-radius: 5px;}


            /* 信息流大图,中图,小图 */
            .list_img_holder{ position: absolute;background:url() #efefef no-repeat center center; background-size:54px; width:90px; height:63px;}
            .list_img_holder img{ border:none; display:block; width:100%; min-height:100%; -webkit-transition:opacity 300ms ease; -moz-transition:opacity ease .3s;  pointer-events: none}
            .list_img_holder_large img{border:none; display:block; width:100%; pointer-events: none}
            .list_img_holder_large_fix img{ position: absolute; }
            .list_image ul{ display:block; margin: 0; padding:0; list-style-type: none; }
            .list_image ul li{ display:inline-block; float:left; overflow:hidden; width:33.3%}
            .list_image ul li .list_img_holder{ margin:0 auto}
            .list_image ul li:first-child .list_img_holder{ float:left}
            .list_image ul li:last-child .list_img_holder{ float:right}

      
 
            .item_info span{margin-right: 5px;opacity: .75}
            #more-loading{ border-top:1px solid #f0f0f0;background-color: #fff}
            #more-loading a{text-align:center;font-size: 16px;;display:block; padding:10px 10px 10px 14px; text-decoration:none; -webkit-tap-highlight-color:rgba(0,0,0,.1); -webkit-touch-callout:none;}
            .nothing{text-align: center;padding:20px 10px;font-size: 20px;color:#999}
            .nothing i{color:#bbb;opacity: .5}

.g-header {
  width: 100%;
  height: 47px;
  border-bottom: 1px solid #ccc;
  background: #fff;
  z-index: 20;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
}.g-header-logo {
  display: block;
  float: left;
  width: 80px;
  height: 40px;
  margin-left: 10px;
  margin-top: 2px;
}em  {
    display: block;
    overflow: hidden;
    width: 100%;font-size: 1rem;
    min-height: 22px;
    max-height: 44px;
    line-height: 22px;
    top: 11px;
}


.article_link img {
    display: block;
 width:100px; height:80px;
    position: absolute;
    left: 0;
    top: 12px;

}.article_link{padding: 10px 0 12px 113px;
    }
        </style>
        
		<script src="static/zepto.js"></script>


    </head>
    <body class="withHeader">
    
<header class="g-header clearfix" id="g-header">
	<a href="/ucenter.php" class="g-header-logo" title="爱悦赚">
		 <img src="Picture1/mlogo.png" onerror="javascript:this.src='Picture1/mlogo.png';">
		<h1 class="l-hide">分享赚</h1>
	</a>
	 
 
</header>

       
        <div class="list_content">
<?php
//转发多域名支持
$rand_sitehead=_rand(6);
$arr_sharesite=explode('#',$config['sharesite']);
$rand=array_rand($arr_sharesite);
$sharesite=$arr_sharesite[$rand];
$sharesite=str_replace('*',$rand_sitehead,$sharesite);//fan

foreach($rows as $row){
$row_pic=str_replace('[weixin]','http://img01.store.sogou.com/net/a/04/link?appid=100520031&w=135&h=90&url=',$row['pic']);
if($row['pv_max']=='-1'){
	$pv_max='无限投放';
}else{
	$pv_max=$row['pv_max'];
}$sy=$row['rs']-$row['cy'];

$jssj="结束时间：".$row['day']  ;
if(strtotime($row['day'])<strtotime(date("Y-m-d"))){
      $jssj='已结束';
}
if($row['top']==1){
	
print <<<div
            <section class="middle_mode has_action">
                <a href="/detailrw.php?aid={$row['id']}&uid={$uid}" class="article_link clearfix">
                  
                   
                        <img src="{$row_pic}" style="opacity: 1;">  <em><font color=red><b>[置顶]</b></font>{$row['title']}</em>
                   
                    <div class="item_info">
                        <span class="cmt">佣金：{$row['money']}</span>
                        <span class="agree"  ><i class="fa fa-thumbs-up"></i>  </span>
                    <br>    <span title="2015-06-30" class="time" >{$jssj}</span>
                    </div>
                </a>
            </section>
div;
}else{
print <<<div
            <section class="middle_mode has_action">
                <a href="/detailrw.php?aid={$row['id']}&uid={$uid}" class="article_link clearfix">
                  
                   
                        <img src="{$row_pic}" style="opacity: 1;">  <em>{$row['title']}</em>
                   
                    <div class="item_info">
                        <span class="cmt">佣金：{$row['money']}</span>
                        <span class="agree" style="display: none"><i class="fa fa-thumbs-up"></i> 925</span><br>
                        <span title="2015-06-30" class="time" >{$jssj} &nbsp;&nbsp;&nbsp;&nbsp; 剩余人数：{$sy}</span>
                    </div>
                </a>
            </section>
div;
}
}
?>		
<div style="margin-top:30px;text-align:center">
	<a href="?page=<?php echo $page_1?>&uid=<?php echo $uid?>&type=<?php echo $typeid?>" class="btn-login">上一页</a>
    <a href="?page=<?php echo $page_2?>&uid=<?php echo $uid?>&type=<?php echo $typeid?>" class="btn-login">下一页</a>
</div>
<br /><br /><br /><br />
        </div>
    </body>
</html>
<?php 
include('footer.php');
$mysql->__destruct();
$mysql->close();
?>